package com.ruoyi.prod.controller;

import com.github.pagehelper.Page;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.prod.entity.po.BaseLog;
import com.ruoyi.prod.service.BaseLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 基础管理-操作日志 前端控制器
 * </p>
 *
 * @author 强子初
 * @since 2023-02-18
 */
@Api(tags = "基础管理-操作日志")
@RestController
@RequestMapping("/base/log")
public class BaseLogController {

    @Autowired
    BaseLogService baseService;

    /**
     * 分页
     */
    @ApiOperation("分页")
    @PostMapping("/page")
    public R<List<BaseLog>> page(@Validated @RequestBody BaseLog condition) {
        Page<BaseLog> page = baseService.page(condition);
        return R.page(page.getResult(), page.toPageInfo());
    }
}
